// DlgIntegralTimes.cpp : implementation file
//

#include "stdafx.h"
#include "Public.h"
#include "PanImage.h"
#include "DlgIntegralTimes.h"


// CDlgIntegralTimes dialog

IMPLEMENT_DYNAMIC(CDlgIntegralTimes, CDialog)

CDlgIntegralTimes::CDlgIntegralTimes(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgIntegralTimes::IDD, pParent)
{

}

CDlgIntegralTimes::~CDlgIntegralTimes()
{
}

void CDlgIntegralTimes::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDlgIntegralTimes, CDialog)
	ON_BN_CLICKED(IDC_BUTTON_OK, &CDlgIntegralTimes::OnBnClickedButtonOk)
	ON_BN_CLICKED(IDC_BUTTON_CANCEL, &CDlgIntegralTimes::OnBnClickedButtonCancel)
END_MESSAGE_MAP()


BOOL CDlgIntegralTimes::OnInitDialog()
{
	CDialog::OnInitDialog();
	char sText[50];
	Safesprintf(sText,_T("%d"),g.xCapBaseCfg.nIntegralTimes);
	SetDlgItemText(IDC_EDIT_Times, sText);
 	return TRUE ;
}

void CDlgIntegralTimes::OnBnClickedButtonOk()
{
	char strText[124] = {0};
	GetDlgItemText(IDC_EDIT_Times,strText,80);  g.xCapBaseCfg.nIntegralTimes = _tstol(strText);
	WriteCfgFile((void*)&g.xCapBaseCfg,sizeof(g.xCapBaseCfg),"CapBaseConfig.bin");
	g.ViewDynamic->LoadIntegralTimes();
	CDialog::EndDialog(0);
}

void CDlgIntegralTimes::OnBnClickedButtonCancel()
{
	CDialog::EndDialog(0);
}
